package com.github.edu.weixin.admin.entity;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

/**
 * Create by IntelliJ IDEA
 * 用户：王建
 * 日期：2018-7-23
 */
@Entity
@Table(name = "T_SYS_WEIXIN_APPLICATION")
public class TSysWeixinApplication implements Serializable {
    private String id;
    private String name;
    private String agentId;
    private String secret;
    private String token;
    private String encodeingAesKey;

    @Id
    @Column(name = "ID")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "NAME")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "AGENT_ID")
    public String getAgentId() {
        return agentId;
    }

    public void setAgentId(String agentId) {
        this.agentId = agentId;
    }

    @Basic
    @Column(name = "SECRET")
    public String getSecret() {
        return secret;
    }

    public void setSecret(String secret) {
        this.secret = secret;
    }

    @Basic
    @Column(name = "TOKEN")
    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    @Basic
    @Column(name = "ENCODEING_AES_KEY")
    public String getEncodeingAesKey() {
        return encodeingAesKey;
    }

    public void setEncodeingAesKey(String encodeingAesKey) {
        this.encodeingAesKey = encodeingAesKey;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TSysWeixinApplication that = (TSysWeixinApplication) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(name, that.name) &&
                Objects.equals(agentId, that.agentId) &&
                Objects.equals(secret, that.secret) &&
                Objects.equals(token, that.token) &&
                Objects.equals(encodeingAesKey, that.encodeingAesKey);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, name, agentId, secret, token, encodeingAesKey);
    }
}
